package cn.itsource.controller.manager;

import cn.itsource.constants.ErrorCode;
import cn.itsource.mapper.LoginMapper;
import cn.itsource.openfeign.LoginOpenfeign;
import cn.itsource.pojo.domain.Login;
import cn.itsource.result.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program fccar-two
 * @Description
 * @Author TT
 * @Date 2024/09/05 17:12
 * @Version 1.0
 */
@RestController
public class LoginApiImplController implements LoginOpenfeign {

    @Autowired
    private LoginMapper loginMapper;
    @Override
    public JSONResult create(Login login) {
        int insert = loginMapper.insert(login);
        if(insert==1){
            return JSONResult.success();
        }
        return JSONResult.error(ErrorCode.PARAM_PHONE_EXIST);
    }
}
